<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>沂水旅游-美食店铺列表</title>
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <link rel="stylesheet" href="/static/layuiadmin/layui/css/layui.css">
    <link rel="stylesheet" href="/static/index/css/base.css">
    <link rel="stylesheet" href="/static/index/css/restaurantList.css">
</head>
<body>

{include file="public/header" model='restaurant' /}

<div class="searchBox">
    <div class="layui-container">
        <div class="mianbaoxie-nav">
            <span class="layui-breadcrumb">
              <a href="/">首页</a>
              <a>
                  <cite>美食列表</cite>
              </a>
            </span>
        </div>

        <div class="layui-row">
            <div class="layui-col-md8">
                <div class="layui-row">
                    <div class="layui-col-md2">
                        <a href="{:url('food/foodList')}">
                            <div class="search-kind-box">
                                <div class="kinds-icon kinds-icon-1 food-kinds-icon-0"></div>
                                <div class="kinds-title">所有类型</div>
                            </div>
                        </a>
                    </div>
                    <div class="layui-col-md2">
                        <a href="{:url('food/foodList')}?kinds=1">
                            <div class="search-kind-box">
                                <div class="kinds-icon kinds-icon-1 food-kinds-icon-1"></div>
                                <div class="kinds-title">特色美食</div>
                            </div>
                        </a>
                    </div>
                    <div class="layui-col-md2">
                        <a href="{:url('food/foodList')}?kinds=2">
                            <div class="search-kind-box">
                                <div class="kinds-icon kinds-icon-1 food-kinds-icon-2"></div>
                                <div class="kinds-title">快餐简餐</div>
                            </div>
                        </a>
                    </div>
                    <div class="layui-col-md2">
                        <a href="{:url('food/foodList')}?kinds=3">
                            <div class="search-kind-box">
                                <div class="kinds-icon kinds-icon-1 food-kinds-icon-3"></div>
                                <div class="kinds-title">主题餐厅</div>
                            </div>
                        </a>
                    </div>
                    <div class="layui-col-md2">
                        <a href="{:url('food/foodList')}?kinds=4">
                            <div class="search-kind-box">
                                <div class="kinds-icon kinds-icon-1 food-kinds-icon-4"></div>
                                <div class="kinds-title">酒吧茶馆</div>
                            </div>
                        </a>
                    </div>

                </div>
            </div>
        </div>

    </div>
</div>

<div class="restaurant-box">
    <div class="layui-container">
        <div class="layui-row layui-col-space30">
            <div class="layui-col-md4 layui-hide-xs">
                <div class="tese-restaurant-list">
                    <div class="tese-restaurant-list-title">
                        特色美食图鉴
                    </div>
                    <ul>

                        {foreach $hotFood as $k => $v}
                        <li>
                            <div class="tese-restaurant-list-name">

                                {eq name="k+1" value='1'}
                                    <span class="layui-badge">
                                {else/}
                                    <span class="layui-badge layui-bg-orange">
                                {/eq}
                                     {$k+1}
                                    </span>

                                <a href="{:url('food/food',['id'=>$v.food_store_id])}">{$v.food_store_name}</a>
                            </div>
                            <div class="tese-restaurant-list-show">
                                <a href="{:url('food/food',['id'=>$v.food_store_id])}">查看详情</a>
                            </div>
                        </li>
                        {/foreach}

                    </ul>
                </div>
            </div>
            <div class="layui-col-md8 layui-col-xs12">

                <div class="layui-row layui-col-space30">

                    {foreach $list as $ke => $va}
                    <div class="layui-col-md4 layui-col-xs12">
                        <a href="{:url('food/food',['id'=>$va.food_store_id])}">
                        <div class="restaurant-list-box">
                            <div class="restaurant-img">
                                <img src="{$va.food_store_cover}" alt="">
                            </div>
                            <div class="restaurant-li-info-box">
                                <div class="restaurant-li-info">
                                    <div class="restaurant-li-info-title">{$va.food_store_name}</div>
                                    <div class="restaurant-li-info-renjun">￥{$va.food_people_money}人均</div>
                                </div>
                                <div class="restaurant-li-info-tag">
                                    {foreach $va.food_tag as $key => $val}
                                    <span>特色美食</span>
                                    {/foreach}
                                </div>
                            </div>
                        </div>
                        </a>
                    </div>
                    {/foreach}

                </div>

                <div class="pageOption" style="padding: 20px  0">
                    {$foodList->render()}
                </div>

            </div>
        </div>
    </div>
</div>


<div style="height: 100px;"></div>

{include file="public/footer" /}

<script>
    var $ = layui.jquery;
        var layer = layui.layer
            , element = layui.element
            ,form = layui.form;


            form.render();
            element.init();

        function getQueryVariable(variable) {
            var query = window.location.search.substring(1);
            var vars = query.split("&");
            for (var i = 0; i < vars.length; i++) {
                var pair = vars[i].split("=");
                if (pair[0] == variable) {
                    return pair[1];
                }
            }
            return (false);
        }

        var kinds = getQueryVariable('kinds');

        if (kinds) {
            switch (kinds * 1) {
                case 1:
                    $('.food-kinds-icon-1').parent().addClass('search-kind-box-active');
                    break;
                case 2:
                    $('.food-kinds-icon-2').parent().addClass('search-kind-box-active');
                    break;

                case 3:
                    $('.food-kinds-icon-3').parent().addClass('search-kind-box-active');
                    break;
                case 4:
                    $('.food-kinds-icon-4').parent().addClass('search-kind-box-active');
                    break;

                default:
                    $('.food-kinds-icon-0').parent().addClass('search-kind-box-active');

            }

        } else {

            $('.food-kinds-icon-0').parent().addClass('search-kind-box-active');

        }
</script>
</body>
</html>